<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Grilla extends CI_Controller {
    public function ayudasTec($transaccion){
        $this->load->model("grillas_model","grillas",TRUE);
        $query = $this->grillas->ayudasTecnicas($transaccion);
    }
    public function administaPer($transaccion){
        $this->load->model("grillas_model","grillas",TRUE);
        $query = $this->grillas->administaPer($transaccion);
    }
    public function expLaboral($transaccion){
        $this->load->model("grillas_model","grillas",TRUE);
        $query = $this->grillas->expLaboral($transaccion);
    }
    public function formAcade($transaccion){
        $this->load->model("grillas_model","grillas",TRUE);
        $query = $this->grillas->formAcade($transaccion);
    }
    public function discapa($transaccion){
        $this->load->model("grillas_model","grillas",TRUE);
        $query = $this->grillas->discapa($transaccion);
    }
    public function ofertaLaboral(){
        $this->load->model("grillas_adv_model","grillas_adv",TRUE);
        $opc = ($this->session->userdata("rolId") == "3")?"I":"P";
        $this->grillas_adv->ofertasLaborales($opc);
    }
    public function consulPer($tran){
        $this->load->model("grillas_adv_model","grillas_adv",TRUE);
        $this->grillas_adv->consulPer($tran);
    }
    public function consPostulados($oferta){
        $this->load->model("grillas_adv_model","grillas_adv",TRUE);
        $this->grillas_adv->consultaPostulados($oferta);
    }
    public function conPostu($transa){
        $this->load->model("grillas_adv_model","grillas_adv",TRUE);
        $this->grillas_adv->conPostu($transa);
    }
    public function conServ($transa){
        $this->load->model("grillas_adv_model","grillas_adv",TRUE);
        $this->grillas_adv->conSolicitudes($transa);
    }
    public function consInstitucione(){
        $this->load->model("grillas_adv_model","grillas_adv",TRUE);
        $this->grillas_adv->consInstitucione();
    }
    public function serviciosyasesoria(){
        $this->load->model("grillas_adv_model","grillas_adv",TRUE);
        $this->grillas_adv->servyasesoria();
    }
    public function sigueOferEmp(){
        $this->load->model("grillas_adv_model","grillas_adv",TRUE);
        $this->grillas_adv->sigueOferEmp();
    }
    public function sigueOferEmpDet($empresa){
        $this->load->model("grillas_adv_model","grillas_adv",TRUE);
        $this->grillas_adv->sigueOferEmpDet($empresa);
    }
    public function segPersona($contra){
        $this->load->model("grillas_adv_model","grillas_adv",TRUE);
        $this->grillas_adv->segPersona($contra);
    }
    public function sigueSolicitud($opc = "activos"){
        $this->load->model("grillas_adv_model2","grillas_adv2",TRUE);
        $this->grillas_adv2->sigueSolicitud($opc);
    }
    public function reporteOfertaLab(){
        $this->load->model("grillas_adv_model2","grillas_adv2",TRUE);
        $this->grillas_adv2->reporteOfertaLab();
    }
    public function reportaPersonaContra($finini = null,$finFin = null,$insti = null){
        $this->load->model("grillas_adv_model2","grillas_adv2",TRUE);
        $this->grillas_adv2->reportaPersonaContra($finini,$finFin,$insti);
    }
    public function reportaInstiContra($finini = null,$finFin = null,$labor = null){
        $this->load->model("grillas_adv_model2","grillas_adv2",TRUE);
        $this->grillas_adv2->reportaInstiContra($finini,$finFin,$labor);
    }
    public function reporteOfertaLabxInst(){
        $this->load->model("grillas_adv_model2","grillas_adv2",TRUE);
        $this->grillas_adv2->reporteOfertaLabxInst();
    }
    public function reporteServAse(){
        $this->load->model("grillas_adv_model2","grillas_adv2",TRUE);
        if($this->session->userdata("rolId") == "1")
            if($this->input->post("empresa") != "")
                $empresa = $this->input->post("empresa");
            else $empresa = "";
        else
            $empresa = $this->session->userdata("tablaUsuarioId");
        $this->grillas_adv2->reporteServAse($empresa);
    }
    public function totalEmpresas(){
        /*Total de empresas del sistema*/
        $this->load->model("grillas_administrador","admin",TRUE);
        $this->admin->totalEmpresas();
    }
    public function totalInstituciones(){
        /*Total de instituciones re*/
        $this->load->model("grillas_administrador","admin",TRUE);
        $this->admin->totalInstituciones();
    }
    public function indicaInstiContra(){
        $this->load->model("grillas_adv_model2","grillas_adv2",TRUE);
        $this->grillas_adv2->indicaInstiContra($this->session->userdata("tablaUsuarioId"));
    }
    public function ofertasPreseleccion(){
        /*Carga la grilla con informacion de las ofertas laborales donde la institucion fue preseleccionada*/
        $this->load->model("grillas_adv_model2","grillas_adv2",TRUE);
        $this->grillas_adv2->ofertasPreseleccion($this->session->userdata("tablaUsuarioId"));
    } //fin public function ofertasPreseleccion(){
    public function enviaContrata($postulacionId){
        /*Obtiene todas las personas postuladas para la oferta laboral especifica*/
        $this->load->model("grillas_adv_model2","grillas_adv2",TRUE);
        $this->grillas_adv2->enviaContrata($postulacionId);
        return ;
    } //fin public function ofertasPreseleccion(){
    public function consultaInstiCiuServicios(){
        /* Extrae todas las instituciones que ofrecen los servicios que se consulta */
        $valor = trim($this->input->post("servicios"),",");
        $valor = explode(",",$valor);
        $this->load->model("grillas_adv_model2","grillas_adv2",TRUE);
        $this->grillas_adv2->consultaInstiCiuServicios($valor,$this->session->userdata("tablaUsuarioId"));
        return ;
    } //fin public function consultaInstiCiuServicios(){
}
